using TMPro;
using UnityEngine;

public class DamageText : MonoBehaviour
{
	public RectTransform tf;

	public TextMeshProUGUI tm;

	public void Show(Vector2 pos, int damageAmount, int colorSwt)
	{
		tm.text = "-" + damageAmount;
		tm.color = ((colorSwt != 1) ? new Color(0f, 0.5f, 1f) : new Color(1f, 0f, 0f));
		tf.anchoredPosition = new Vector2(pos.x + Random.Range(-2f, 2f), pos.y + Random.Range(3f, 6f));
	}

	public void DeActive()
	{
		base.gameObject.SetActive(false);
	}
}
